//
//  NearViewController.m
//  FKGW
//
//  Created by song ce on 2017/2/15.
//  Copyright © 2017年 song ce. All rights reserved.
//

#import "NearViewController.h"
#import "NearShopViewController.h"
#import "NearIndustryViewController.h"
#import "DAPagesContainer.h"


@interface NearViewController ()
@property(nonatomic,strong)NearShopViewController *shopVCtrl;
@property(nonatomic,strong)NearIndustryViewController *indutryVCtrl;
@property(strong, nonatomic)DAPagesContainer *pagesContainer;

@end

@implementation NearViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.vcName = @"附近";
    [self daPageCtrl];
}

- (void)daPageCtrl{
    NSMutableArray *controllersArray = [NSMutableArray array];
    self.shopVCtrl = [[NearShopViewController alloc]init];
    self.shopVCtrl.masterViewControllerForPush = self;
    self.shopVCtrl.title = @"商场";
    [controllersArray addObject:self.shopVCtrl];
    
    self.indutryVCtrl = [[NearIndustryViewController alloc]init];
    self.indutryVCtrl.masterViewControllerForPush = self;
    self.indutryVCtrl.title = @"行业";
    [controllersArray addObject:self.indutryVCtrl];
    
    [self setUpPagesContainersWithChildControllers:controllersArray];
}
-(void)setUpPagesContainersWithChildControllers:(NSArray *)controllers {
    self.pagesContainer = [[DAPagesContainer alloc] init];
    [self.pagesContainer willMoveToParentViewController:self];
    self.pagesContainer.view.frame = CGRectMake(0, kNaviBarHeight, Main_Screen_Width, Main_Screen_Height-kNaviBarHeight-49);
    self.pagesContainer.pageIndicatorColor = DEF_COLOR;
    self.pagesContainer.pageItemsTitleColor =[UIColor colorWithRed:102./255 green:102./255 blue:102./255 alpha:1.];
    self.pagesContainer.topBarBackgroundColor = [UIColor whiteColor];
    self.pagesContainer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    self.pagesContainer.topBarHeight = 44;
    [self.view addSubview:self.pagesContainer.view];
    [self.pagesContainer didMoveToParentViewController:self];
    
    self.pagesContainer.viewControllers = controllers;
//    self.pagesContainer.pageType = DAPagesContainerNear;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
